KYB Documents OCR API
This document highlights the KYB document API details.
API Description
Objective
The KYB Documents OCR API extracts information from an image or PDF of a KYB Document and returns it in a JSON format. The API supports the following document types:
- Shop and Establishment certificate
- Udyam Certificate
- GST certificate
- Certificate of Incorporation
This product might provide mixed results when used on other business documents. We recommend discussing it with the HyperVerge team before using it on other business documents.
| Input | Output |
|---|---|
| An image, PDF, or S3 URL of a supported KYB document | The KYB related information extracted from the image. The complete list of output fields is provided under the Success Response Details section. |
API URL
https://ind-engine.thomas.hyperverge.co/v1/KYBDocumentsOCR
API Endpoint
KYBDocumentsOCR
Overview
The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.
Authentication
You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the API.
API Request Details
Method - POST
Headers
| Parameter | Mandatory or Optional | Description | Valid Values |
|---|---|---|---|
| content-type | Mandatory | This parameter defines the media type for the request payload. | multipart/form-data |
| appId | Mandatory | Application ID shared by HyperVerge | N/A. This is a unique value. |
| appKey | Mandatory | Application Key shared by HyperVerge | N/A. This is a unique value. |
| transactionId | Mandatory | Unique ID for the customer journey. | N/A. Any defined unique value mapped to a transaction in your business ecosystem. |
Inputs
The following table provides the details of the parameters required for the API's request body:
| Parameter | Mandatory or Optional | Description | Allowed Values | Valid Values |
|---|---|---|---|---|
image | Mandatory (optional if base64image is given) | This is the KYB file on which you intended to run the OCR extraction | The file format can be JPG, JPEG, PNG, TIFF or PDF | Not Applicable |
outputImageBase64 | Optional | Returns the image in base64 format | 'yes' or 'no' | Not Applicable |
base64image | Mandatory (optional if image is given) | Base64-encoded string representation of the KYB document. The API internally converts this string back to a file format before performing OCR extraction. Supported formats include JPEG, PNG, TIFF, or PDFs. | string (base64 format of the image or the pdf) | Not Applicable |
responseType | Optional | When set to 'v2', returns a flattened response structure with a single result object instead of an array. When empty or not provided, returns the standard array format. This parameter is useful for integration with systems that expect a single result object rather than an array. | 'v2' or empty | Not Applicable |
s3Url | Optional | A valid S3 URL pointing to the KYB document stored in an S3 bucket. This parameter enables server-side resume functionality in workflows by allowing the API to directly access documents from cloud storage. When provided, the API will fetch the document from the specified S3 URL instead of processing a base64-encoded image. Supported document formats include JPEG, PNG, TIFF, and PDF. | string (valid S3 URL) | Not Applicable |
Request
The following code snippet demonstrates a standard curl request for the API:
curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/KYBDocumentsOCR' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'image=@"<path_to_image_file>"' \
--form 'base64image="<base64_string_of_the_file>"' \
--form 'outputImageBase64="<yes_or_no>"' \
--form 'responseType="<v2_or_empty>"' \
--form 's3Url="<Enter_the_S3_URL>"'
Success Responses
The following code snippets demonstrate success responses from the API:
1. Responses for different valid KYB documents whenresponseType parameter is empty :
- GST Certificate
- Shop & Establishment Certificate
- Udyam Certificate
- Certificate of Incorporation
{
"status": "success",
"statusCode": "200",
"result": [
{
"details": {
"reg_no": {
"value": "27** *********Z2",
"conf": 0.93,
"to-be-reviewed": "no"
},
"legal_name": {
"value": "",
"conf": 0,
"to-be-reviewed": "yes"
},
"trade_name": {
"value": "COLLECTION",
"conf": 0.79,
"to-be-reviewed": "no"
},
"business_constitution": {
"value": "PROPRIETORSHIP",
"conf": 0.99,
"to-be-reviewed": "no"
},
"address": {
"value": "<Masked_Address>",
"conf": 0.94,
"to-be-reviewed": "no"
},
"date_liability": {
"value": "",
"conf": 0,
"to-be-reviewed": "yes"
},
"valid_from": {
"value": "01/07/2017",
"conf": 0.99,
"to-be-reviewed": "no"
},
"valid_till": {
"value": "",
"conf": 0,
"to-be-reviewed": "yes"
},
"type": {
"value": "",
"conf": 0,
"to-be-reviewed": "yes"
}
},
"base64Image": "base64_string",
"type": "GST"
}
],
"requestId": "<Request_ID>"
}
{
"status": "success",
"statusCode": "200",
"result": [
{
"details": {
"name": {
"value": "<Name_of_the_Owner>",
"conf": 0.97,
"to-be-reviewed": "no"
},
"business_name": {
"value": "<Business_Name>",
"conf": 0.93,
"to-be-reviewed": "no"
},
"address": {
"value": "<Masked_Address>",
"conf": 0.97,
"to-be-reviewed": "no"
}
},
"base64Image": "base64_string",
"type": "ShopEstablishmentCertificate"
}
],
"requestId": "<Request_ID>"
}
{
"status": "success",
"statusCode": "200",
"result": [
{
"details": {
"type": {
"value": "<Type_of_Document>",
"conf": 0,
"to-be-reviewed": "yes"
},
"reg_no": {
"value": "UDYAM",
"conf": 0.71,
"to-be-reviewed": "yes"
},
"enterprise_name": {
"value": "<Enterprise_Name>",
"conf": 0,
"to-be-reviewed": "yes"
},
"date_incorporation": {
"value": "<Incorporation_Date>",
"conf": 0,
"to-be-reviewed": "yes"
},
"date_commencement": {
"value": "<Commencement_Date>",
"conf": 0,
"to-be-reviewed": "yes"
},
"date_registration": {
"value": "11/08/2020 27/09/2020",
"conf": 0.5,
"to-be-reviewed": "yes"
},
"flat_door_no": {
"value": "66",
"conf": 0.98,
"to-be-reviewed": "no"
},
"building_name": {
"value": "SOLAN KALEEN",
"conf": 0.62,
"to-be-reviewed": "yes"
},
"village_town": {
"value": "<Village_Town_Name>",
"conf": 0,
"to-be-reviewed": "yes"
},
"block": {
"value": "<Block_Name>",
"conf": 0,
"to-be-reviewed": "yes"
},
"street_name": {
"value": "<Street_Name>",
"conf": 0,
"to-be-reviewed": "yes"
},
"city": {
"value": "<City_Name>",
"conf": 0,
"to-be-reviewed": "yes"
},
"state": {
"value": "<State_Name>",
"conf": 0,
"to-be-reviewed": "yes"
},
"district": {
"value": "PIN",
"conf": 0.4,
"to-be-reviewed": "yes"
},
"mobile_no": {
"value": "<Mobile_Number>",
"conf": 0.99,
"to-be-reviewed": "no"
},
"email": {
"value": "<Email_Address>",
"conf": 0.52,
"to-be-reviewed": "yes"
}
},
"base64Image": "base64_string",
"type": "MSME"
}
],
"requestId": "<Request_ID>"
}
{
"status": "success",
"statusCode": "200",
"result": [
{
"details": {
"cin": {
"value": "U72900KA2019FTC130185",
"conf": 0.99,
"to-be-reviewed": "no"
},
"pan": {
"value": "AAHCT6329H",
"conf": 0.98,
"to-be-reviewed": "no"
},
"tan": {
"value": "BLRT16604A",
"conf": 0.97,
"to-be-reviewed": "no"
},
"company_name": {
"value": "TROPOGO TECHNOLOGIES PRIVATE LIMITED",
"conf": 0.95,
"to-be-reviewed": "no"
},
"company_address": {
"value": "175 & 176 , DOLLORS COLONY , JP NAGAR ,, BANNERGHATTA MAIN ROAD ,, BENGALURU , BANGALORE , KARNATAKA , INDIA , 560076",
"conf": 0.74,
"to-be-reviewed": "yes"
}
},
"base64Image": "base64_string",
"type": "COI"
}
],
"requestId": "<Request_ID>"
}
responseType parameter is "v2" :
- GST Certificate
- Shop & Establishment Certificate
- Udyam Certificate
- Certificate of Incorporation
{
"status": "success",
"statusCode": "200",
"result": {
"details": {
"reg_no": {
"value": "<masked>",
"conf": 0.97,
"to-be-reviewed": "no"
},
"legal_name": {
"value": "<masked>",
"conf": 0.99,
"to-be-reviewed": "no"
},
"trade_name": {
"value": "<masked>",
"conf": 0.98,
"to-be-reviewed": "no"
},
"business_constitution": {
"value": "PROPRIETORSHIP",
"conf": 0.99,
"to-be-reviewed": "no"
},
"address": {
"value": "<masked>",
"conf": 0.75,
"to-be-reviewed": "yes"
},
"date_liability": {
"value": "<masked>",
"conf": 0,
"to-be-reviewed": "yes"
},
"valid_from": {
"value": "<masked>",
"conf": 0.99,
"to-be-reviewed": "no"
},
"valid_till": {
"value": "<masked>",
"conf": 0.99,
"to-be-reviewed": "no"
},
"type": {
"value": "REGULAR",
"conf": 0.99,
"to-be-reviewed": "no"
}
},
"base64Image": "base64_string",
"type": "GST"
}
}
{
"status": "success",
"statusCode": "200",
"result": {
"details": {
"name": {
"value": "<masked>",
"conf": 0.98,
"to-be-reviewed": "no"
},
"business_name": {
"value": "<masked>",
"conf": 0.99,
"to-be-reviewed": "no"
},
"address": {
"value": "<masked>",
"conf": 0.9,
"to-be-reviewed": "no"
}
},
"base64Image": "base64_string",
"type": "ShopEstablishmentCertificate"
}
}
{
"status": "success",
"statusCode": "200",
"result": {
"details": {
"type": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"reg_no": {
"value": "<masked>",
"conf": 0.99,
"to-be-reviewed": "no"
},
"enterprise_name": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"date_incorporation": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"date_commencement": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"date_registration": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"flat_door_no": {
"value": "00",
"conf": 1,
"to-be-reviewed": "no"
},
"building_name": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"village_town": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"block": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"street_name": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"city": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"state": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"district": {
"value": "<masked>",
"conf": 0.58,
"to-be-reviewed": "no"
},
"mobile_no": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"email": {
"value": "<masked>",
"conf": 1,
"to-be-reviewed": "no"
},
"nic_2digit": {
"value": "47",
"conf": 0.99,
"to-be-reviewed": "no"
},
"nic_4digit": {
"value": "4711",
"conf": 0.99,
"to-be-reviewed": "no"
},
"nic_5digit": {
"value": "47110",
"conf": 0.99,
"to-be-reviewed": "no"
},
"activity": {
"value": "Trading",
"conf": 0.99,
"to-be-reviewed": "no"
}
},
"base64Image": "base64_string",
"type": "MSME"
}
}
{
"status": "success",
"statusCode": "200",
"result": {
"details": {
"cin": {
"value": "<masked>",
"conf": 0.99,
"to-be-reviewed": "no"
},
"pan": {
"value": "<masked>",
"conf": 0,
"to-be-reviewed": "yes"
},
"tan": {
"value": "<masked>",
"conf": 0,
"to-be-reviewed": "yes"
},
"company_name": {
"value": "<masked>",
"conf": 0.97,
"to-be-reviewed": "no"
},
"company_address": {
"value": "<masked>",
"conf": 0.88,
"to-be-reviewed": "no"
}
},
"base64Image": "base64_string",
"type": "COI"
}
}
Success Response Details
The following table outlines the details of the success response from the API:
| Parameter | Type | Description |
|---|---|---|
| status | string | The status of the API request |
| statusCode | string or integer | The HTTP status code for the API response |
| result | object or array | The extracted details from the KYB document; returns an array of objects if responseType is empty, or a single object if responseType is set to v2 |
| result.details | object | The key-value pairs of extracted fields from the document, such as registration number, legal name, trade name, business constitution, address, and other document-specific fields |
| result.details.[field].value | string | The extracted value for the specific field |
| result.details.[field].conf | number | The confidence score for the extracted value, ranging from 0 to 1 |
| result.details.[field].to-be-reviewed | string | Indicates if the extracted value should be manually reviewed; possible values are yes or no |
| result.base64Image | string | The base64-encoded image of the document, returned if outputImageBase64 is set to yes |
| result.type | string | The type of KYB document detected, such as GST, ShopEstablishmentCertificate, MSME, or COI |
| requestId | string | The unique identifier for the API request |
Failure Response
The following is a sample failure response where the API fails to detect a document from the image:
{
"status": "failure",
"statusCode": 422,
"error": "No Document detected",
"requestId": "<Request_ID>"
}
Error Responses
The following are some error responses for the API:
- Missing Input Image
- Multiple Input Images
- Image Size Issue
{
"status": "failure",
"statusCode": "400",
"error": "API call requires one input image",
"requestId": "<Request_ID>"
}
{
"status": "failure",
"statusCode": "400",
"error": "API call handles only one input image",
"requestId": "<Request_ID>"
}
{
"status": "failure",
"statusCode": "400",
"error": "image size cannot be greater than 12MB",
"requestId": "<Request_ID>"
}
Failure and Error Response Details
A failure or error response from the module contains a failure status, with a relevant status code and error message.
The following table lists all error responses:
| Status Code | Error Message | Error Description |
|---|---|---|
| 400 | No Image input | The request missed the image input. |
| 400 | More than 1 image input | The request had more than one image file input. It expects only one file in the request. |
| 400 | image size cannot be greater than 12MB | The image size is larger than the allowed limit. |
| 422 | Document not detected from Image | The API failed to detect a document in the image. Ensure that the image captures the document following the guidlines mentioned under the Input Image Guidelines section. |
| 5xx | Internal Server Error | There was an error with HyperVerge's server. Please contact the HyperVerge team. |